/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "collector")
@NamedQueries({
    @NamedQuery(name = "Collector.findAll", query = "SELECT c FROM Collector c"),
    @NamedQuery(name = "Collector.findByIdcollector", query = "SELECT c FROM Collector c WHERE c.idcollector = :idcollector"),
    @NamedQuery(name = "Collector.findByCollector", query = "SELECT c FROM Collector c WHERE c.collector = :collector")})
public class Collector implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idcollector")
    private Integer idcollector;
    @Column(name = "collector")
    private String collector;
    @OneToMany(mappedBy = "collector", fetch = FetchType.LAZY)
    private List<Monitoring> monitoringList;

    public Collector() {
    }

    public Collector(Integer idcollector) {
        this.idcollector = idcollector;
    }

    public Integer getIdcollector() {
        return idcollector;
    }

    public void setIdcollector(Integer idcollector) {
        this.idcollector = idcollector;
    }

    public String getCollector() {
        return collector;
    }

    public void setCollector(String collector) {
        this.collector = collector;
    }

    public List<Monitoring> getMonitoringList() {
        return monitoringList;
    }

    public void setMonitoringList(List<Monitoring> monitoringList) {
        this.monitoringList = monitoringList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcollector != null ? idcollector.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Collector)) {
            return false;
        }
        Collector other = (Collector) object;
        if ((this.idcollector == null && other.idcollector != null) || (this.idcollector != null && !this.idcollector.equals(other.idcollector))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Collector[idcollector=" + idcollector + "]";
    }

}
